<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<style>
#nprogress .bar{ 
  height: 3px !important;
  background: orange !important; 
}
#nprogress .peg { 
  box-shadow: 0 0 10px #00000000, 0 0 5px #00000000 !important; 
}
#nprogress .spinner-icon {
  display:none;
}
</style>

<script>
import NProgress from "nprogress"; 

export default {
  name: "App",
 


  mounted() {
    window.addEventListener("scroll", this.handleScroll); // 监听滚动条事件
  },
  methods: {
    handleScroll() {
      // 屏幕剩余的高度
      let surplus =
        document.documentElement.scrollHeight -
        document.documentElement.clientHeight;
      // 当前滑动高度
      let scrollY = document.documentElement.scrollTop;
      // 当前位置百分比小数
      let coorY = scrollY / surplus;
      // 设置导航栏，这里使用NProgress.set() 动态更改进度条
     NProgress.set(coorY);
    }
  }
};
</script>
